<?php
/**
 * CEOfox
 *
 * @copyright  Copyright 2011-2012 CEOfox, Inc.
 * @license    http://ceofox.com/pages/license
 * @version    $Id: index.html.php 97088 2013-05-24 09:40:17 $
 * @author     CEOfox, Inc.
 */
?>
<?php

defined('PHPFOX') or exit('NO DICE!');

?>
{if isset($sFeedOf)}

    <input type="hidden" id="feed_of" value="{$sFeedOf}">
{/if}
{*if $bIsCurrentUser != 1 and $bIsLogin and isset($bIsFollow) and $bIsFollow == true}
    <a href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aUser.user_id}" style="text-decoration: none;">
        <span  onclick="window.location.href = '{url link='follow.del'}id_{$aUser.user_id}'" class="following follow-button  follow-text" style="float:right; margin-bottom: 10px;">{phrase var='follow.following'}</span >
    </a>
{/if*}
<div class="clear"></div>
{if isset($aIndex_Followers) and count($aIndex_Followers)}
<div id="index_follower">
    <div class="table_header">{phrase var='follow.followers'} - {phrase var='follow.search_result_s_for_keyword_amount_user' keyword=$sKeyword amount=$iAmountResult}</div>
        {foreach from=$aIndex_Followers item=aIndex_Follower name=follower}        
        <div id="js_follower_{$aIndex_Follower.user_id}" class="follower_row_holder js_selector_class_{$aIndex_Follower.user_id} {if is_int($phpfox.iteration.follower/2)}row1{else}row2{/if}{if $phpfox.iteration.follower == 1 && !PHPFOX_IS_AJAX} row_first{/if}">
            <div class="friend_image" id="js_image_div_{$aIndex_Follower.user_id}">    
                {img id='sJsUserImage_'$aIndex_Follower.user_id'' user=$aIndex_Follower suffix='_50_square' max_width=50 max_height=50}
            </div>
            <div class="friend_user_name">
                {$aIndex_Follower|user:'':'':50} 
            </div>
            {if $bIsCurrentUser == true && Phpfox::isUser()}
                <a class="follow-inline-btn block_{$sType}_{$aIndex_Follower.user_id}" href="{url link='follow.block' id=$aIndex_Follower.user_id type=$sType oid=Phpfox::getUserId()}"><span class="block follow-button " style="float:right">{phrase var='follow.block'}</span ></a>
                
                <a class="follow-inline-btn unblock_{$sType}_{$aIndex_Follower.user_id}" href="{url link='follow.unblock' id=$aIndex_Follower.user_id type=$sType oid=Phpfox::getUserId()}"><span class="block follow-button " style="float:right">{phrase var='follow.unblock'}</span ></a>
            {/if}
            {if !$aIndex_Follower.isFollow && $aIndex_Follower.canFollow  && Phpfox::isUser()}
                <a class="follow-inline-btn follow_{$sType}_{$aIndex_Follower.user_id}" href="{url link='follow.add' id=Phpfox::getUserId() type=$sType oid=$aIndex_Follower.user_id}"><span class="block follow-button " style="float:right">{phrase var='follow.follow'}</span ></a>  
                
                <a class="follow-inline-btn unfollow_{$sType}_{$aIndex_Follower.user_id}" href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aIndex_Follower.user_id}"><span class="block follow-button " style="float:right">{phrase var='follow.unfollow'}</span ></a>  
            {/if}
        </div>
        {/foreach}
</div>
{else}
    {if isset($aIndex_Followers)}
        <div class="message">
            {phrase var='follow.no_result_found'}
        </div>
    {/if}
{/if}
{if isset($aIndex_Followings) and count($aIndex_Followings)}
<div id="index_following">
    <div class="table_header">{phrase var='follow.following'} - {phrase var='follow.search_result_s_for_keyword_amount_user' keyword=$sKeyword amount=$iAmountResult}</div>
        {foreach from=$aIndex_Followings item=aIndex_Following name=following}        
        <div id="js_following_{$aIndex_Following.user_id}" class="following_row_holder js_selector_class_{$aIndex_Following.user_id} {if is_int($phpfox.iteration.following/2)}row1{else}row2{/if}{if $phpfox.iteration.following == 1 && !PHPFOX_IS_AJAX} row_first{/if}">
            <div class="friend_image" id="js_image_div_{$aIndex_Following.user_id}">    
                {img id='sJsUserImage_'$aIndex_Following.user_id'' user=$aIndex_Following suffix='_50_square' max_width=50 max_height=50}
            </div>
            <div class="friend_user_name">
                {$aIndex_Following|user:'':'':50} 
            </div>
            {if $bIsCurrentUser == true and $bIsLogin}
                <a class="follow-inline-btn unfollow_{$sType}_{$aIndex_Following.user_id}" href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aIndex_Following.user_id}">
                    <span class="following follow-button  follow-text" style="float:right" onmouseover="$Core.follow.changeText();">{phrase var='follow.following'}</span >
                </a>
                <a class="follow-inline-btn follow_{$sType}_{$aIndex_Following.user_id}" href="{url link='follow.add' id=Phpfox::getUserId() type=$sType oid=$aIndex_Following.user_id}">
                    <span class="follow follow-button" style="float:right">{phrase var='follow.follow'}</span >
                </a>
            {/if}
            
            {*if $aIndex_Following.isFollow == 0 and $aIndex_Following.canFollow == 1 and Phpfox::isUser()}
                <a class="follow-inline-btn follow_{$sType}_{$aIndex_Following.user_id}" href="{url link='follow.add' id=Phpfox::getUserId() type=$sType oid=$aIndex_Following.user_id}">
                    <span class="follow follow-button " style="float:right">{phrase var='follow.follow'}</span >             
                </a>
                <a style="display:none;" class="follow-inline-btn unfollow_{$sType}_{$aIndex_Following.user_id}" href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aIndex_Following.user_id}">
                    <span class="follow follow-button " style="float:right">{phrase var='follow.unfollow'}</span >             
                </a>
            {/if*}
        </div>
        {/foreach}
</div>
{else}
{if isset($aIndex_Followings)}
<div class="message">
    {phrase var='follow.no_result_found'}
</div>
{/if}
{/if}
{if $bIsCurrentUser == true}
    {if isset($aIndex_Blockers) and count($aIndex_Blockers)}
    <div id="index_blocker">
        <div class="table_header">{phrase var='follow.block'} - {phrase var='follow.search_result_s_for_keyword_amount_user' keyword=$sKeyword amount=$iAmountResult}</div>
            {foreach from=$aIndex_Blockers item=aIndex_Blocker name=blocker}        
            <div id="js_blocker_{$aIndex_Blocker.user_id}" class="blocker_row_holder js_selector_class_{$aIndex_Blocker.user_id} {if is_int($phpfox.iteration.blocker/2)}row1{else}row2{/if}{if $phpfox.iteration.blocker == 1 && !PHPFOX_IS_AJAX} row_first{/if}">
                <div class="friend_image" id="js_image_div_{$aIndex_Blocker.user_id}">    
                    {img id='sJsUserImage_'$aIndex_Blocker.user_id'' user=$aIndex_Blocker suffix='_50_square' max_width=50 max_height=50}
                </div>
                <div class="friend_user_name">
                    {$aIndex_Blocker|user:'':'':50} 
                </div>
                    <a class="follow-inline-btn block_{$sType}_{$aIndex_Blocker.user_id}" href="{url link='follow.block' id=$aIndex_Blocker.user_id type=$sType oid=Phpfox::getUserId()}">
                        <span class="unblock follow-button " style="float:right">{phrase var='follow.block'}</span >             
                    </a>
                    <a  style="display: none;" class="follow-inline-btn unblock_{$sType}_{$aIndex_Blocker.user_id}" href="{url link='follow.unblock' id=$aIndex_Blocker.user_id type=$sType oid=Phpfox::getUserId()}">
                        <span class="unblock follow-button " style="float:right">{phrase var='follow.unblock'}</span >             
                    </a>
            </div>
            {/foreach}
    </div>
    {else}
    {if isset($aIndex_Blockers)}
            <div class="message">
                {phrase var='follow.no_result_found'}
            </div>
        {/if}
    {/if}
{/if}
{module name='follow.follower'}
{module name='follow.following'}
{if $bIsCurrentUser == true}
    {module name='follow.blocker'}
{/if}
{if !$bIsCurrentUser && isset($bIsFollow) && $bIsFollow}
    {template file='follow.block.setting' aFilter=$aFilter bHasFollowed=$bIsFollow}
{/if}
{if isset($aFeeds)}
    {if $bIsCurrentUser}
        {*phrase var='follow.activity_feed_from_following'*}
    {else}
        <div class="table_header" style="margin-top:15px;">
            {phrase var='follow.activity_feed_from_following_full_name' full_name=$aUser.full_name}
        </div>
    {/if}
    {template file='follow.block.display'}
{/if}
{if !$bIsCurrentUser && (!isset($bIsFollow) || !$bIsFollow)}
    {if $bCanFollow}
        <div class="error_message">{phrase var='follow.follow_this_user_to_get_feed'}</div>
        {*<a href="{url link='follow.add' following-id=$aUser.user_id}">
            <span  onclick="window.location.href = '{url link='follow.add' following-id=$aUser.user_id}'" class="following follow-button " style="float: right; margin-top: 7px; margin-bottom: 10px;">{phrase var='follow.follow'}</span >
        </a>*}
    {/if}
{/if}
<div class="clear"></div>
{pager}

